import { axiosInstance } from './axios-instance';

export interface ExamStatistics {
  scoreDistribution: { score: number; count: number }[];
  passRate: number;
  averageScore: number;
  totalStudents: number;
  highestScore: number;
  lowestScore: number;
}

export async function getExamStatistics(examId: number): Promise<ExamStatistics> {
  const response = await axiosInstance.get<ExamStatistics>(`/exams/${examId}/statistics`);
  return response.data;
}